<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c"   uri="http://java.sun.com/jsp/jstl/core" %>
<%@include file="/comm/mytags.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>后台管理系统</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="keywords" content="后台管理系统">
    <meta name="description" content="致力于提供通用版本后台管理解决方案">

    <link rel="shortcut icon" href="${ctx}/static/img/favicon.ico">
    <link rel="stylesheet" href="${ctx}/static/layui_v2/css/layui.css">
    <link rel="stylesheet" href="${ctx}/static/css/global.css">
    <link rel="stylesheet" type="text/css" href="${ctx}/static/css/common.css" media="all">
    <link rel="stylesheet" type="text/css" href="${ctx}/static/css/personal.css" media="all">
    <link rel="stylesheet" type="text/css" href="http://at.alicdn.com/t/font_9h680jcse4620529.css">
    <script src="${ctx}/static/layui_v2/layui.js"></script>

<body>
<div class="larry-grid layui-anim layui-anim-upbit larryTheme-A ">
    <div class="larry-personal">
        <div class="layui-tab layui-tab-brief" lay-filter="filterSysLogTab">
            <ul class="layui-tab-title">
                <li class="layui-this">班级列表</li>
            </ul>
            <div class="layui-tab-content" style="padding: 0px">
                <!-- 业务日志TAB -->
                <div class="layui-tab-item layui-show">
                    <blockquote class="layui-elem-quote mylog-info-tit" style="border-bottom: 0px; margin: 10px 15px;">

                        <div class="layui-form-item" style="margin-bottom: 0px;">
                            <input type="hidden" id="currentDate" value="${currentDate}">
                            <form class="layui-form" id="sysSearchForm">
                                <div class="layui-inline" style="margin: 0px;">
                                    <input type="hidden" name="logType" value="info">
                                    <%--<div class="layui-input-inline" style="width:110px;">
                                        <select name="searchTerm">
                                            <option value="logTitleTerm">日志标题</option>
                                            <option value="logMethodTerm">请求方式</option>
                                        </select>
                                    </div>--%>
                                    <div class="layui-input-inline" style="width:145px;">
                                        <label class="layui-form-label" style="width:auto;">请输入班级名称</label>
                                        <input type="text" name="searchContent" value="" placeholder="请输入关键字" class="layui-input search_input">
                                    </div>
                                </div>
                               <%-- <div class="layui-inline" style="margin:0px;">
                                    <label class="layui-form-label" style="width:auto;">请求时间</label>
                                    <div class="layui-input-inline" style="width:145px;">
                                        <input type="text" class="layui-input" id="beginTime" name="beginTime" placeholder="请选择" readonly>
                                    </div>
                                </div>--%>
                                <div class="layui-inline" style="margin:0px;">
                                    <a class="layui-btn sysSearch_btn" lay-submit lay-filter="sysSearchFilter"><i class="layui-icon larry-icon larry-chaxun7"></i>查询</a>
                                </div>
                                <div class="layui-inline"  style="margin:0px;">

                                    <a class="layui-btn layui-btn-normal stuAdd_btn"   <c:if test="${LOGIN_NAME.userName == '超级管理员'}">  style=" display: none;" </c:if>> <i class="layui-icon larry-icon larry-xinzeng1"></i>新增评价</a>

                                </div>
                                <div class="layui-inline" style="margin:0px;">
                                    <a class="layui-btn layui-btn-normal excelSysLogExport_btn"  style="background-color:#5FB878"> <i class="layui-icon larry-icon larry-danye"></i>导出</a>
                                </div>

                            </form>
                        </div>
                    </blockquote>
                    <div class="larry-separate"></div>
                    <div style=" margin: 10px 15px;">
                        <!--  业务日志列表 -->
                        <table id="stuTableList" lay-filter="stuTableId" ></table>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>

<script type="text/javascript">
    var $,table,common;
    layui.config({
        base : "${ctx}/static/js/"
    }).use(['form', 'table','common','element','laydate'], function () {
        $ =  layui.$;
        table = layui.table;
        common = layui.common;

       var  form = layui.form,
        element = layui.element,
        laydate = layui.laydate;

        //表格加载
        sysLogTable();

        /**业务日志查询*/
        $(".sysSearch_btn").click(function(){
            var loading = layer.load(0,{ shade: [0.3,'#000']});

            //监听提交
            form.on('submit(sysSearchFilter)', function (data) {
                table.reload('stuTableId',{
                    where: {
                        sname:data.field.searchContent,
                    },
                    height: 'full-183',
                    page: true,
                    done: function (res, curr, count) {
                        common.resizeGrid();
                        layer.close(loading);

                    }
                });

            });

        });


        /**新增用户*/
        $(".stuAdd_btn").click(function(){
            var url = "${ctx}/EvaluateTeach/EvaluateTeach_add.do";
            common.cmsLayOpen('新增评价',url,'750px','550px');
        });

        /**业务日志导出*/
        $(".excelSysLogExport_btn").click(function(){
            var url = '${ctx}/syslog/excel_sys_log_export.do';
            $("#sysSearchForm").attr("action",url);
            $("#sysSearchForm").submit();
        });


        /**监听工具条*/
        table.on('tool(stuTableId)', function(obj){
            var data = obj.data; //获得当前行数据
            var layEvent = obj.event; //获得 lay-event 对应的值

            //修改用户
            if(layEvent === 'stu_edit') {
                var classId = data.id;
                var url = "${ctx}/score/score_update.do?classId="+classId;
                common.cmsLayOpen('编辑班级',url,'zzz350px','250px');

                //分配角色
            }else if(layEvent === 'stu_fail') {
                var evaluateId = data.id;
                var url = "${ctx}/EvaluateTeach/ajax_EvaluateTeach_del.do";
                var param = {evaluateId:evaluateId};
                common.ajaxCmsConfirm('系统提示', '确定删除此教师课程吗?',url,param);

            }
        });

    });


    /**业务日志table*/
    function sysLogTable() {
        var loading = layer.load(0,{ shade: [0.3,'#000']});

        table.render({
            elem: '#stuTableList',
            url: '${ctx}/EvaluateTeach/ajax_EvaluateTeach_list.do',
            id:'stuTableId',
            method: 'post',
            height:'full',
            skin:'row',
            even:'true',
            size: 'sm',
            where: {
                logType:'info',
                beginTime:$("#currentDate").val(),
            },
            cols: [[
                {type:"numbers"},
                {field:'tName', title: '教师',align:'center' },
                {field:'stuName', title: '评价人',align:'center'},
                {field:'evaluate', title: '评价',align:'center'},
                {field:'excellent', title: '级别',align:'center',width: '10%',templet: '#stuStatusTpl'},
                {title: '操作', align:'center', width: '20%',toolbar: '#stuBar'}
            ]],
            page: true,
            limit: 10,//默认显示10条
            done: function (res, curr, count) {
                common.resizeGrid();
                layer.close(loading);

            }
        });

    }





</script>

<script type="text/html" id="stuStatusTpl">

    {{# if(d.excellent == 0){ }}
    <span style="color:#5FB878;font-weight:bold"> 0-优</span>
    {{# } else if(d.excellent == 1){ }}
    <span style="color:#FF5722;font-weight:bold"> 1-良</span>
    {{# } else if(d.excellent == 2){ }}
    <span style="color:#FF5722;font-weight:bold"> 2-差</span>
    {{# } else { }}
    {{d.userStatus}}
    {{# }  }}
</script>


<!--工具条 -->
<script type="text/html" id="stuBar">
    <div class="layui-btn-group">
        <a class="layui-btn layui-btn-xs layui-btn-danger stu_fail" lay-event="stu_fail"><i class="layui-icon larry-icon larry-ttpodicon"></i>删除</a>
    </div>
</script>




</body>
</html>